UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XvU74b5alxgobLSGJlJL7DbEDAj6Rj7xR2SjeKrj+uM=' 
WHERE 
  key_id = 'ef20317be5a7a2d3a072c156153bd694aa523e6a35f89f62b30bf384f18ecda3' 
  AND (
    token = 'XvU74b5alxgobLSGJlJL7DbEDAj6Rj7xR2SjeKrj+uM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060