UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5+EGrAtArUxFAdhsVG/BeiISDHfqF2dnhxxYzzwqeBs='
WHERE
key_id = 'bfcecec41c48e1f88e9c755bd96e2b9f7d4064bd007dfd124c95bf63c5fc4c1b'
AND (
token = '5+EGrAtArUxFAdhsVG/BeiISDHfqF2dnhxxYzzwqeBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)