UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GxIrC1/Uhdoom0eR5pNM4IYRJ+542K5Az9S9+ruM08E=' 
WHERE 
  key_id = '2bb14d30f51062712e1715c4851b2a278e35d83a4c7f9a2f724b5488a0646d72' 
  AND (
    token = 'GxIrC1/Uhdoom0eR5pNM4IYRJ+542K5Az9S9+ruM08E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017