UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZR9coPVC9WhEfWtOuGGXio4CtRuwhG2eDmG3TwlbRSY=' 
WHERE 
  key_id = '0611668a76dec0e654a40368d78a5e4f925e7cdc8cc9445f65e3242488a724c0' 
  AND (
    token = 'ZR9coPVC9WhEfWtOuGGXio4CtRuwhG2eDmG3TwlbRSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040