UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MRM+cROqE/3NzFSlaBUKisTDDVoBrP1i0lyYV8KxFQQ='
WHERE
key_id = 'c503e255b3b2badb6b98c9bc3fd7134e5a6e55f57d252a06f7c17e5befeb14f3'
AND (
token = 'MRM+cROqE/3NzFSlaBUKisTDDVoBrP1i0lyYV8KxFQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)