UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ecpaE7tdkFPoWkQXGWWjlLeJfM75IAYcS9lJuCQh17Q=' 
WHERE 
  key_id = '8a037b4059b18bc416dd033da239e1634f465d9c4eb96a19d98ef7fcaeb7a83f' 
  AND (
    token = 'ecpaE7tdkFPoWkQXGWWjlLeJfM75IAYcS9lJuCQh17Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047