UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JFsa4wBbviRaUyAvlkRTNbIgDlDxL3VEY7Xw/ol2cpA='
WHERE
key_id = 'd2c1eef260713cbab67f716b1a48344df58d806f7a66ceec8e3ecc3136af36a4'
AND (
token = 'JFsa4wBbviRaUyAvlkRTNbIgDlDxL3VEY7Xw/ol2cpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)