UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SytwRaY8ycBDVUx2nzmmbx4BTTpJbJCHjwLCiJrgDT8=' 
WHERE 
  key_id = '600cb5955160fea757f867e4e559edaafe0c9899f23ea0c4dde1887e8a72d1eb' 
  AND (
    token = 'SytwRaY8ycBDVUx2nzmmbx4BTTpJbJCHjwLCiJrgDT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026