UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xLKHe/b+nhu0F76coEVUcxHKmcbvnZN6iWHFZGOckUQ=' 
WHERE 
  key_id = '34a2cdce9508dc4e047ceb6f2370e79018bdb3be99349b0db53698676bf22e29' 
  AND (
    token = 'xLKHe/b+nhu0F76coEVUcxHKmcbvnZN6iWHFZGOckUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031