UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GdjyDiuzDZoSAQ5KaXSqE34OOU+/tHth8ooK6At1Bd4=' 
WHERE 
  key_id = '4cc12076e24ac4e41a2ce495087fa0e13463141be490e994108daf9ac0835421' 
  AND (
    token = 'GdjyDiuzDZoSAQ5KaXSqE34OOU+/tHth8ooK6At1Bd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033