UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qbz5U6PdkDwhC8gecwclqKCnvZKNzhtjWsEu5gRSj7o=' 
WHERE 
  key_id = 'c2fd1a41dd15e62aa690b3e2979886c9128943986177099dbf5d6f7f50cf25f2' 
  AND (
    token = 'qbz5U6PdkDwhC8gecwclqKCnvZKNzhtjWsEu5gRSj7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042