UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rpUceRGyObeipAsWN42PwbmbXNaJhbqxKAo8AJFTcp8='
WHERE
key_id = '97db0441cf537dacf1ddb0a5ed05abb195715dab57cfacebf3df39e1c5061da4'
AND (
token = 'rpUceRGyObeipAsWN42PwbmbXNaJhbqxKAo8AJFTcp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)