UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k2oleNTInyyjLfspOTb4iJX9aMsLGc792CVZgD3fUZw=' 
WHERE 
  key_id = '883e7a1b87fc118cdc57d7348f17b2d8dcf67ba5001127728e27b641f6bff140' 
  AND (
    token = 'k2oleNTInyyjLfspOTb4iJX9aMsLGc792CVZgD3fUZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029