UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nFMr6TJE4Y4hbx4fya5n3VVELRJo1s22EIciMImFOJI=' 
WHERE 
  key_id = '7694b2beb7cdbdea29fcabd009ed5392259cf15b79e7d786a423fbdb38a6ae47' 
  AND (
    token = 'nFMr6TJE4Y4hbx4fya5n3VVELRJo1s22EIciMImFOJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038