UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M4/hhIvr8xEt16Dxl8OqcsDSWtHM6yiOAB3fbvp9AAk=' 
WHERE 
  key_id = '208e0f7213341a48a88cd8e577f316e5b66c7c8313e4d6b79cf8d3984c1fb945' 
  AND (
    token = 'M4/hhIvr8xEt16Dxl8OqcsDSWtHM6yiOAB3fbvp9AAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029