UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2zocDhHQlSfmvIK6loNPbqPdtnpw1Fw0y9Ms6QhvO4='
WHERE
key_id = '585e77ea4cbd9732e0f3ba3fa152c29b1a1f64eb89bf5e0c99a4587d6910a466'
AND (
token = 's2zocDhHQlSfmvIK6loNPbqPdtnpw1Fw0y9Ms6QhvO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)