UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u753ajZPgp5nA9BRROu9Q12pfXSCdUYGGiWUOHqRQsk='
WHERE
key_id = '2954866c55d491ed99507919e4a4c4b969095d94da41a85cb04f0d605f338ea4'
AND (
token = 'u753ajZPgp5nA9BRROu9Q12pfXSCdUYGGiWUOHqRQsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)