UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2rjQkF3pQ42EgAcJYMGr16ZeNu8xDt0Eh199adLB30='
WHERE
key_id = '55865e35de9a680795c873cae3df822f63ad47c2e8c8d12faa31adba6f22e24e'
AND (
token = 'w2rjQkF3pQ42EgAcJYMGr16ZeNu8xDt0Eh199adLB30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)