UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DbrNf8+Y5BDgU1GOcB/7+46Jv4x4Vru0UxeB57SzueU=' 
WHERE 
  key_id = '526170d4ef944c77c89bf7d51be38c03d0e65fa3fe3dd77acbd9abb84278611c' 
  AND (
    token = 'DbrNf8+Y5BDgU1GOcB/7+46Jv4x4Vru0UxeB57SzueU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059