UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NQOEuh9/f8f/7GbLep3DRYhWAiLnVcUExOU81HJ9msI=' 
WHERE 
  key_id = '056d3cb2c1793354ab4c71a6be0b86ebed61fd461fdddd3b28905f02a5e596f4' 
  AND (
    token = 'NQOEuh9/f8f/7GbLep3DRYhWAiLnVcUExOU81HJ9msI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027