UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rXxFZJ0ZtR9aIHbvzOpP9Jd8I3+tcpvzSrfNIlNVkkE=' 
WHERE 
  key_id = 'f550fa3fafd8fd780bc4c2003635c1319db4483ceadf6e3b0f505388f76da60d' 
  AND (
    token = 'rXxFZJ0ZtR9aIHbvzOpP9Jd8I3+tcpvzSrfNIlNVkkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037