UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tG0FKPLQ+VSFUIWcje1q7CD/dwaKil9bu0sJmlUqY7g='
WHERE
key_id = '4040dbc2f33e2f0862544c8dfd9585ace4e3d7bd2d1caf5db4000c066978b37a'
AND (
token = 'tG0FKPLQ+VSFUIWcje1q7CD/dwaKil9bu0sJmlUqY7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)