UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QciLiUHxMDA8RicpCyKcoFIDxYzXSN6yRqnh4OT5oiE='
WHERE
key_id = '2b211a2d74fd151c09352f1b2b9b4d004e229890e77925e64c9af33e2139d739'
AND (
token = 'QciLiUHxMDA8RicpCyKcoFIDxYzXSN6yRqnh4OT5oiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)