UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OK95WmBvSgtghEClAtiIOOI/4FGwKLHOhmqCoLPxQ5c='
WHERE
key_id = 'c6a1c7da1b953c3bf4eb5ab5f9721abf787acff8b61861b8e3a7040b75c80e87'
AND (
token = 'OK95WmBvSgtghEClAtiIOOI/4FGwKLHOhmqCoLPxQ5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)