UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2d0OkhHBxIo+8zC8sBnNDquvpy+312+DQGA0UMiPOzY='
WHERE
key_id = '7854b09e711afbd2e5daf613db1200d2cba2fab296bf9e8cbbe2da292c1c83b9'
AND (
token = '2d0OkhHBxIo+8zC8sBnNDquvpy+312+DQGA0UMiPOzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)