UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '09n34G34oLrsEl7krnSB+cCQTdeCxVQ1Oc972aW5WpA='
WHERE
key_id = '7390428719cbebf6b5df895e19cce6bedd5af794d41997eb0a1c88f005c3eadb'
AND (
token = '09n34G34oLrsEl7krnSB+cCQTdeCxVQ1Oc972aW5WpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)