UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Ms91gr0ok/jem1cCgvwZWh1SYP85clGwBTY4aRGwfw='
WHERE
key_id = 'd0e3e5b6b5ed869447782b182591a9e43f0c12d598854085eb54d4fe9b3561c9'
AND (
token = '3Ms91gr0ok/jem1cCgvwZWh1SYP85clGwBTY4aRGwfw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)