UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WqDmBYh+n2erUWfaUhFET97VUA69Vq8DNJAgVR2ebYQ=' 
WHERE 
  key_id = '4b3eadd4634f71ee0aae256efc2ceac965baa759454f0e382cb590b0fc01ff06' 
  AND (
    token = 'WqDmBYh+n2erUWfaUhFET97VUA69Vq8DNJAgVR2ebYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040