UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kNSjrlpZCue51LWiYWyrDKbxShXhQu3PIPxdYVraXf4='
WHERE
key_id = '1972c1382a001eb5384caf888ddb7453a54901b5ad28fd8ee2662f09ae440711'
AND (
token = 'kNSjrlpZCue51LWiYWyrDKbxShXhQu3PIPxdYVraXf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)