UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ow7MCriSG4ais+Bsy4GQKJw78HeJ2sXZHmwvSjfYKVs='
WHERE
key_id = 'f4a0a3ac51f0c916da91d0cf13f1e70047b1768fa56952b17f6cc570f998a20c'
AND (
token = 'ow7MCriSG4ais+Bsy4GQKJw78HeJ2sXZHmwvSjfYKVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)