UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TUPPKrjuF5LB0J0gopWtzaAs9y4iiSXTElgR2SwhK/8=' 
WHERE 
  key_id = 'cc4f6f9af7b3eecaa673b47112a67f16125d0e7c48384a5b3cada368f70a0716' 
  AND (
    token = 'TUPPKrjuF5LB0J0gopWtzaAs9y4iiSXTElgR2SwhK/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041