UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ivuxM+ARP9GHey7dXo8i4uF5UtOB0WRScpea448y30='
WHERE
key_id = '9f2b981da3a97a9271e3dfd09cefdfda4691760c1b8dd3acabdb68ae998ec2bb'
AND (
token = '4ivuxM+ARP9GHey7dXo8i4uF5UtOB0WRScpea448y30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)