UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XDA/jGs5JfaLLromWLVyzgB/1e3YyPVeN4PkqtMtHmk='
WHERE
key_id = 'c7eefd3411e793b930fa41ef758de4dc312a821beb3ea00da5cf917c82adc045'
AND (
token = 'XDA/jGs5JfaLLromWLVyzgB/1e3YyPVeN4PkqtMtHmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)