UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zc7f7WMvafwN4W1+mRMdKS1RhN04S9If3ThFKLxRRHg='
WHERE
key_id = '00933fd81d63fee99f717532714d73fae9c41842447f82e96a2030204b14f11f'
AND (
token = 'zc7f7WMvafwN4W1+mRMdKS1RhN04S9If3ThFKLxRRHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)