UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pOG9MBSMk8bbDdwIX/RXFZ5zwFNAIHsjra0p++9CafY=' 
WHERE 
  key_id = '8157f08b0cf1e840c266ce9b54dc87633e9822627034aa57f8d8b1d81bda2108' 
  AND (
    token = 'pOG9MBSMk8bbDdwIX/RXFZ5zwFNAIHsjra0p++9CafY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020