UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7oIggHL8/5/H/zLwVy36zf1HPDX9Dz5U+O7XdB/vAVI=' 
WHERE 
  key_id = '79a0927afa581ef41c160e298e1af3cc42b877add37db6f76ae79a87f6da986a' 
  AND (
    token = '7oIggHL8/5/H/zLwVy36zf1HPDX9Dz5U+O7XdB/vAVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024