UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+woMwU4VEn2H+/dCqDFTsD4E7cW1IN7h+DipMnXWmM='
WHERE
key_id = '5dc023656dfcb1ed1b5d42b69fc9823f6bc08e605f320a635d842ce5d8f11b0e'
AND (
token = 'T+woMwU4VEn2H+/dCqDFTsD4E7cW1IN7h+DipMnXWmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)