UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q2qrAV5Q+OlYe0TOBUwYsKVfdjI2UUWa95apjXWAmug='
WHERE
key_id = '6152f0d6e47373f0f99dc18b5d15304e8d4bacfdce69b11de218cadf9506c671'
AND (
token = 'Q2qrAV5Q+OlYe0TOBUwYsKVfdjI2UUWa95apjXWAmug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)