UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7v5Q42uylhUEn9tw52bLokrtT+3rR5sf0KlP1ioTJXI='
WHERE
key_id = 'e32db0714cb9354ba5b49b2058c4db352b7c4372607b3db47ba0822f32f10f9b'
AND (
token = '7v5Q42uylhUEn9tw52bLokrtT+3rR5sf0KlP1ioTJXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)