UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W7hNsM3DQT6sqqDl9jOYFqyj5UJ+GNohg6yLGG3E/YE=' 
WHERE 
  key_id = 'f6ac70b354cb201ad14c363df2fd8b66f6e61356cc7c89388443996768974fd8' 
  AND (
    token = 'W7hNsM3DQT6sqqDl9jOYFqyj5UJ+GNohg6yLGG3E/YE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017