UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I7pV/6TbeexyrVbiMZoR6jiiUbrFn9WjRtancPiD1Aw='
WHERE
key_id = '804d4fa4b75a61f16d98ebd554445db0efeac1773e0af1a9d4e1bc625d054bee'
AND (
token = 'I7pV/6TbeexyrVbiMZoR6jiiUbrFn9WjRtancPiD1Aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)