UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PTRasS5HzB+BYOmgBtVDVzHj9A0OsadW1oIRsPS30N0='
WHERE
key_id = '3de13c6593e5e5c97132ce83483664b7a10e048dd0d8bda933bfab1f9237f369'
AND (
token = 'PTRasS5HzB+BYOmgBtVDVzHj9A0OsadW1oIRsPS30N0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)